package com.mybatis.sp.mybatisexamle_xml.service.impl;

import com.mybatis.sp.mybatisexamle_xml.mapper.master.CustomerMapper;
import com.mybatis.sp.mybatisexamle_xml.pojo.Customer;
import com.mybatis.sp.mybatisexamle_xml.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CustomerServiceImpl implements CustomerService {

    @Autowired
    private CustomerMapper customerMapper;


    @Override
    public List<Customer> findAll() {
        return customerMapper.findAll();
    }

    @Override
    public Customer findById(Integer id) {
        return customerMapper.findById(id);
    }

    @Override
    public void deleteById(Integer id) {
        customerMapper.deleteById(id);
    }

    @Override
    public void updateById(Customer customer) {
        customerMapper.updateById(customer);
    }

    @Override
    public void save(Customer customer) {
        customerMapper.save(customer);
    }
}
